package org.bbelovic.devel.exercises.collatz;

public class AxisConfigurator {

    private final int axisLength;
    private final int maxValue;
    
    public AxisConfigurator(int axisLength, int maxValue) {
        this.axisLength = axisLength;
        this.maxValue = maxValue;
    }

    public int getAxisLength() {
        return axisLength;
    }

    public int getMaxValue() {
        return maxValue;
    }

    public int computeSteps() {
        return computeStepsInternal();
    }

    public int computeScaleStep() {
        final int steps = computeStepsInternal();
        return (int) Math.ceil((double) maxValue / steps);
    }

    private int computeStepsInternal() {
        int result = maxValue / axisLength;
        if (result < 1) {
            return 10;
        } else {
            return 5;
        }
    }

}
